package com.ruoyi.system.domain;

import com.ruoyi.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 文件上传对象 sys_file
 *
 * @author ruoyi
 * @date 2024-07-01
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class File {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 分片上传的uploadId
     */
    @Excel(name = "分片上传的uploadId")
    private String uploadId;

    /**
     * 文件唯一标识（md5）
     */
    @Excel(name = "文件唯一标识", readConverterExp = "m=d5")
    private String fileMd5;

    /**
     * 文件名
     */
    @Excel(name = "文件名")
    private String fileName;

    private String fileExtension;

    /**
     * 桶名
     */
    @Excel(name = "桶名")
    private String bucketName;

    /**
     * 文件存储路径
     */
    @Excel(name = "文件存储路径")
    private String objectName;

    /**
     * 文件大小（byte）
     */
    @Excel(name = "文件大小", readConverterExp = "b=yte")
    private Long fileSize;

    /**
     * 每个分片大小（byte）
     */
    @Excel(name = "每个分片大小", readConverterExp = "b=yte")
    private Long chunkSize;

    /**
     * 分片数量
     */
    @Excel(name = "分片数量")
    private Integer chunkNum;

    /**
     * 是否上传完成(1：是  0：否)
     */
    @Excel(name = "是否上传完成(1：是  0：否)")
    private String isFinish;

    private String createBy;
    private Date createTime;
    private String delFlag;


    public Boolean isFinish() {
        return "1".equals(this.isFinish) ? true : false;
    }

}
